<template>
    <el-container>
        <el-tabs type="border-card" class="Wh" @tab-click="onClick">
            <el-tab-pane label="未审核"  class="Wh">
                <el-header>
                    <video-review-search :handleSearch="handleSearch" :tabE="0" :vrFlag="vrFlag"></video-review-search>
                </el-header>
                <el-main class="main">
                    <video-review-list :vrData="vrData" :refreshFlag="refreshFlag" :totalS="total" :tabE="0"></video-review-list>
                </el-main>
            </el-tab-pane>
            <el-tab-pane label="已通过" class="Wh">
                <el-header>
                    <video-review-search :handleSearch="handleSearch" :tabE="1" :vrFlag="reFlag"></video-review-search>
                </el-header>
                <el-main class="main">
                    <video-review-list :vrData="vrDataT" :refreshFlag="refreshFlag" :totalS="total" :tabE="1"></video-review-list>
                </el-main>
            </el-tab-pane>
            <el-tab-pane label="未通过" class="Wh">
                <el-header>
                    <video-review-search :handleSearch="handleSearch" :tabE="2" :vrFlag="reFlag"></video-review-search>
                </el-header>
                <el-main class="main">
                    <video-review-list :vrData="vrDataW" :refreshFlag="refreshFlag" :totalS="total" :tabE="2"></video-review-list>
                </el-main>
            </el-tab-pane>
          </el-tabs>
    </el-container>
</template>

<script>
import videoReviewList from './videoReviewList.vue';
import videoReviewSearch from './videoReviewSearch.vue';
export default {
    components: {
        videoReviewSearch:videoReviewSearch,
        videoReviewList:videoReviewList,
    },

    data() {
        return {
            vrData: [],
            vrDataT:[],
            vrDataW:[],
            total:0,
            refreshFlag: false,
            vrFlag: false,
            reFlag:true,
        };
    },

    created(){
        
    },

    methods: {
        handleSearch(res,bs) {
            if(bs==0){
                this.vrData = res.data.content
                this.total = res.data.totalSize
            
            }else if(bs==1){
                this.vrDataT = res.data.content
                this.total = res.data.totalSize
                
            }else{
                this.vrDataW = res.data.content
                this.total = res.data.totalSize
            }
        },

        onClick() {
            // 切换 refreshFlag 的值来触发 video-list 组件刷新
            this.refreshFlag = !this.refreshFlag;
        }
        
    }
}
</script>

<style scoped>
.main{
    margin-top: 35px;
}
.Wh{
    width: 100%;
}
</style>